package cn.aylog.service.impl;

import cn.aylog.dao.EmployeeDao;
import cn.aylog.pojo.Employee;
import cn.aylog.service.IEmployee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeImpl implements IEmployee {
    @Autowired
    private EmployeeDao dao;

    @Override
    public Employee list(Integer id) {
        return dao.listById(id);
    }

    @Override
    public List<Employee> list() {
        return dao.listAll();
    }

    @Override
    public void update(Employee employee) {
        dao.update(employee);
    }

    @Override
    public Employee delete(Integer id) {
        return dao.delete(id);
    }

    @Override
    public void add(Employee employee) {
        dao.add(employee);
    }
}
